package com.elong.android.specialhouse.entity;

import java.io.Serializable;
import java.util.List;

/**
 * @author yang.yu
 * @ClassName: FilterCondition
 * @Description: 筛选实体类
 * @date 2015-9-6 下午4:54:42
 */
public class FilterCondition implements Serializable{
	
	public final static int DEFAULT_PEOPLE_MIN = 1;
	public final static int DEFAULT_BED_MIN = 0;//0表示不限
	public final static int PRICE_MAX = 1100;//1100表示1000+
	public final static int PRICE_MIN = 0;
	public int HighestPrice = PRICE_MAX; 
	public int LowestPrice =PRICE_MIN; 
	public  List<Integer> RentalType;
	public short NumberOfPeople = DEFAULT_PEOPLE_MIN;
	public short NumberOfBeds = DEFAULT_BED_MIN;
	
	public int getHighestPrice() {
		return HighestPrice;
	}
	public void setHighestPrice(int highestPrice) {
		HighestPrice = highestPrice;
	}
	public int getLowestPrice() {
		return LowestPrice;
	}
	public void setLowestPrice(int lowestPrice) {
		LowestPrice = lowestPrice;
	}
	public List<Integer> getRentalType() {
		return RentalType;
	}
	public void setRentalType(List<Integer> rentalType) {
		RentalType = rentalType;
	}
	public short getNumberOfPeople() {
		return NumberOfPeople;
	}
	public void setNumberOfPeople(short numberOfPeople) {
		NumberOfPeople = numberOfPeople;
	}
	public short getNumberOfBeds() {
		return NumberOfBeds;
	}
	public void setNumberOfBeds(short numberOfBeds) {
		NumberOfBeds = numberOfBeds;
	}
	
	public void clear() {
		HighestPrice=PRICE_MAX;
		LowestPrice=PRICE_MIN;
		NumberOfPeople= DEFAULT_PEOPLE_MIN;
		NumberOfBeds= DEFAULT_BED_MIN;
		if(RentalType !=null){
			RentalType.clear();
		}
	}
	/**
	    判断是否带筛选条件
	 */
	public boolean isClear(){
		if( HighestPrice == PRICE_MAX &&
			LowestPrice == PRICE_MIN &&
		    NumberOfPeople == DEFAULT_PEOPLE_MIN &&
			NumberOfBeds == DEFAULT_BED_MIN ){
			if(RentalType !=null && !RentalType.isEmpty()){
			   return false;
			}
			return true;
		}
		return false;
	}
}
